<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link href="../lib/metro.css" rel="stylesheet">

    <title>Test Keypad - Metro UI :: Popular HTML, CSS and JS library</title>

</head>
<body class="m4-cloak">
<div class="container">
    <h1>Keypad test page</h1>

    <div>
        <input type="text"
               data-role="keypad"
               data-keys="1,2,3,4,5,6,7,8,9,ok"
               data-except-keys="ok"
               data-key-separator="-"
               data-on-key="onKey"
        >
    </div>

    <br>
    <div>
        <input type="text" data-role="keypad" id="kp1" data-keys="q,w,e,r,t,y,u,i,o,p,a,s,d,f,g,h,j,k,l,z,x,c,v ,b,n,m,Q,W,E,R,T,Y,U,I,O,P,A,S,D,F,G,H,J,K,L,M">
        <input type="text" data-role="keypad" data-label="Enter secret key:">
    </div>

    <br>
    <div>
        <button class="button" onclick="addKeypad()">Add keypad</button>
        <div id="wrapper"></div>
    </div>

</div>

<script src="../lib/metro.js"></script>
<script>
    function onKey(key, value, el){
        console.log(el);
        console.log("Input value now ", value);
        console.log("Input value now ", value);
    }


    function addKeypad(){
        $("#wrapper").append("<input id='aaa' value='113232' type='text' data-role='keypad'>");
    }

    $(function(){
        $("#kp1").val(1000);
        // Metro.getPlugin("#kp1", 'keypad').val(1000);
    })
</script>
</body>
</html>
